package com.maybach.common.enums.user;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhaoshuai on 16/1/14.
 */
public enum UserStatusEnum {

    logical_delete(-1, "逻辑删除"),
    normal(1, "正常"),
    disable(2, "禁用");

    private int code;

    private String desc;

    UserStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static List<Integer> getAllStatusValues() {
        List<Integer> statusValues = new ArrayList<>();
        for (UserStatusEnum statusEnum : UserStatusEnum.values()) {
            statusValues.add(statusEnum.getCode());
        }
        return statusValues;
    }

    public static boolean isRightStatusValue(int value) {
        return getAllStatusValues().contains(value);
    }
}
